﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using xfsale.lib;
using xfsale.ui;
using xfsale.packet;

namespace xfsale.ui.acct
{
    public partial class FrmTransAcctUnlock : FrmBase
    {
        public FrmTransAcctUnlock()
        {
            InitializeComponent();
        }

        private void BtnOk_Click(object sender, EventArgs e)
        {
            string password = GetTradePassword();

            try
            {
                //填充请求数据
                TransAcctUnlockRequest request = new TransAcctUnlockRequest();
                request.tradePassword = password;
                Bind(request);

                //调用服务
                TransAcctUnlockResponse response = (TransAcctUnlockResponse)CallService(request);

                //处理应答结果
                if (response.returnCode == "0000")
                {
                    txtOrderSheetNo.Text = response.orderSerialNo;
                    SysMessage.Info("交易账户解锁成功！");
                }
                else
                {
                    SysMessage.Error(response.returnMsg);
                }
            }
            catch (Exception ex)
            {
                SysMessage.Error(ex.Message);
            }
        }

        private void BtnClose_Click(object sender, EventArgs e)
        {
            CloseFrame();
        }

        private void FrmAcctTransCancel_Load(object sender, EventArgs e)
        {
            if (!this.DesignMode)
            {
            }
        }

        private void BtnClear_Click(object sender, EventArgs e)
        {
            Reset();
        }
    }
}
